﻿using System.Globalization;

public static class DoubleExtension
{
    /// <summary>
    /// Display the given <code>double</code> to euro currency
    /// </summary>
    /// <param name="Price">double to convert into euro format</param>
    /// <param name="DisplayCents">Display cents if <code>true</code> (Default is true)</param>
    /// <returns>A string of the Price converted into euro format</returns>
    public static string ToEuro(this double Price, bool DisplayCents = true)
    {
        return Price.ToString(DisplayCents ? "c" : "C0", new CultureInfo("fr-FR"));
    }
}
